Skip to content

Split ApplyEngine into focused partial modules - #11733

Merged
Amaury Levé (Evangelink) merged 2 commits into
mainfrom
copilot/code-simplifier-split-applyengine-cs
Oct 5, 2026
Merged

Amaury Levé (Evangelink) merged 2 commits into
mainfrom
copilot/code-simplifier-split-applyengine-cs

Conversation

Copilot AI commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

ApplyEngine.cs combined orchestration, selection parsing, source edits, verification, file I/O, and result shaping in one 768-line file. This refactor separates those responsibilities without changing behavior or API surface.

  • Orchestration

    • Retain ApplyAsync and shared records in ApplyEngine.cs.
  • Focused modules

    • Move agent output parsing to ApplyEngine.AgentSelection.cs.
    • Move Roslyn edits to ApplyEngine.Edits.cs.
    • Move candidate verification to ApplyEngine.Verification.cs.
    • Move snapshot and restoration operations to ApplyEngine.FileIO.cs.
    • Move result and PR metadata construction to ApplyEngine.Results.cs.
  • Compatibility

    • Preserve method bodies, signatures, accessibility, and UTF-8 BOM encoding.
    • Keep ApplyEngine internal and static using partial declarations.

Copilot AI balanced review requested due to automatic review settings October 3, 2026 19:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 3, 2026 19:16
Copilot AI changed the title [WIP] Simplify ApplyEngine.cs into focused modules Split ApplyEngine into focused partial modules Oct 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused split preserves the original implementations, accessibility, project inclusion, and required file encoding.

Review effort: Balanced
Findings: None

@Evangelink
Amaury Levé (Evangelink) marked this pull request as ready for review October 3, 2026 19:58
@github-actions github-actions Bot added the state/needs-review Awaiting review from the team. label Oct 3, 2026
@Evangelink
Amaury Levé (Evangelink) enabled auto-merge (squash) October 3, 2026 19:58
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Oct 3, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.

Review outcome: No actionable findings — this is a byte-for-byte mechanical refactor.

Change classification

  • Internal tooling (.github/workflows/unskip-closed-tests-tool/): ApplyEngine.cs (768 lines, one monolithic internal static class) was split into a partial class spread across ApplyEngine.cs, ApplyEngine.AgentSelection.cs, ApplyEngine.Edits.cs, ApplyEngine.FileIO.cs, ApplyEngine.Results.cs, and ApplyEngine.Verification.cs, grouped by concern (agent-output parsing, syntax-tree edit construction, file I/O, result/PR-body building, and subprocess-based verification).

Confidence at a glance

🟢 Correctness & design — verified no behavioral delta
  • Why it applies: Structural refactor of logic that enforces security/contract invariants (path containment, hash staleness checks, verification subprocess sandboxing) for an internal CI tool.
  • Evidence: Extracted and sorted every non-boilerplate statement line from the pre-refactor ApplyEngine.cs (git history) and from the six post-refactor files; the two sorted sets are identical line-for-line (470 lines each, zero diff). No method bodies, field initializers, or control flow were altered — only using/namespace/class-declaration boilerplate and method placement changed.
  • Gap or disposition: None. This is pure code organization; the restricted-env-var allowlist, path/reparse-point guards, overlapping-edit rejection, and verification timeout/kill-tree handling are all preserved verbatim.
  • Action: None.
🟢 Naming & conventions — file-scoped namespace, BOM, partial-class pattern all consistent
  • Why it applies: New files must follow repo conventions (UTF-8 BOM, file-scoped namespace, StyleCop rules).
  • Evidence: All six files use file-scoped namespace UnskipClosedTests.Tool;, carry a UTF-8 BOM, and the split uses the standard internal static partial class ApplyEngine pattern consistently across files.
  • Action: None.

⚪ Not applicable: Threading & concurrency, Security & IPC, Public API & compatibility, Performance, Cross-TFM, Resource management, Localization, Tests, Analyzers, Build/dependencies/scripts, IPC wire compatibility (this tool is internal CI tooling, not a shipping MSTest/MTP package; no public API, resource, or wire-format surface is touched; no test files changed in this PR).

@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Oct 3, 2026
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Oct 3, 2026
@Evangelink
Amaury Levé (Evangelink) merged commit 5fd8523 into main Oct 5, 2026
28 of 29 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Oct 5, 2026
@Evangelink
Amaury Levé (Evangelink) deleted the copilot/code-simplifier-split-applyengine-cs branch October 5, 2026 07:28
@microsoft-github-policy-service microsoft-github-policy-service Bot removed the state/needs-review Awaiting review from the team. label Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[code-simplifier] Split ApplyEngine.cs into focused modules

4 participants